<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .input-col-m {
                width: 60px;
            }

            .input-col-l {
                width: 80px;
            }

            .input-col-xxl {
                width: 1%;
                text-align: right;
            }

            .col-95 {
                text-align: left;
            }

            .col-5 {
                text-align: left;
            }
        </style>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }
        </script>

    </ui:define>

    <ui:define name="content">
        <div style="margin:5px;" id="top">
            <h:form id="qryForm">
                <p:growl id="msgs" showDetail="false"/>
                <p:panel id="query" header="补发对账明细信息">
                    <h:panelGrid columns="2" cellspacing="3" style="width:100%">
                        <h:panelGrid columns="1" cellspacing="3" style="width:80%">
                            <h:panelGroup>
                                <h:outputLabel value="补发日期：" style="font-weight: bold;text-align: right"/>
                                <p:inputText id="startDate" required="true" requiredMessage="必须输入日期！"
                                             value="#{rsAccDetailAction.beginDate}" style="text-align: left"
                                             onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
                            </h:panelGroup>
                        </h:panelGrid>
                        <h:panelGrid style="width:20%;" columns="2">
                            <h:panelGroup>
                                <p:commandButton style="width:70px" ajax="true"
                                                 action="#{rsAccDetailAction.onQueryForSend}" id="btnQuery"
                                                 value="查询" update="msgs,pdt">
                                </p:commandButton>
                            </h:panelGroup>
                            <h:panelGroup>
                                <p:commandButton style="width:90px" ajax="true"
                                                 action="#{rsAccDetailAction.onSend}" id="btnSend"
                                                 value="全部发送" update="msgs,pdt">
                                </p:commandButton>
                            </h:panelGroup>
                        </h:panelGrid>
                    </h:panelGrid>
                </p:panel>
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloading.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <p:dataTable id="pdt" dynamic="true" selectionMode="single"
                             value="#{rsAccDetailAction.rsAccDetailList}" var="record"
                             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             paginator="true" rows="15" paginatorPosition="bottom"
                             rowsPerPageTemplate="100,50,30,15,5" rowKey="Pkid"
                             emptyMessage="数据记录为空...">
                    <p:column headerText="Pkid" style="display:none;">
                        <h:outputText style="display: none;" value="#{record.pkId}"/>
                    </p:column>

                    <p:column headerText="监管账号">
                        <h:outputText value="#{record.accountCode}"/>
                    </p:column>

                    <p:column headerText="监管账户">
                        <h:outputText value="#{record.accountName}"/>
                    </p:column>

                    <p:column headerText="对方账号">
                        <h:outputText value="#{record.toAccountCode}"/>
                    </p:column>
                    <p:column headerText="对方账户名">
                        <h:outputText value="#{record.toAccountName}"/>
                    </p:column>

                    <p:column headerText="收支标志" style="align:center;">
                        <h:outputText style="text-align: center;"
                                      value="#{rsAccDetailAction.inOutFlag.valueOfAlias(record.inoutFlag).title}"/>
                    </p:column>

                    <p:column headerText="交易类型" style="align:center;">
                        <h:outputText style="text-align: center;"
                                      value="#{rsAccDetailAction.tradeType.valueOfAlias(record.tradeType).title}"/>
                    </p:column>

                    <p:column headerText="交易金额">
                        <h:outputText style="float:right;" value="#{record.tradeAmt}">
                            <f:convertNumber pattern="###,##0.00"/>
                        </h:outputText>
                    </p:column>
                    <p:column headerText="交易后余额">
                        <h:outputText style="float:right;" value="#{record.balance}">
                            <f:convertNumber pattern="###,##0.00"/>
                        </h:outputText>
                    </p:column>
                    <p:column headerText="交易时间" style="text-align:center;">
                        <h:outputText value="#{record.tradeDate}">
                        </h:outputText>
                    </p:column>
                    <p:column headerText="状态标志" style="text-align:center;">
                        <h:outputText
                                value="#{rsAccDetailAction.tradeStatus.valueOfAlias(record.statusFlag).title}"/>
                    </p:column>
                </p:dataTable>
            </h:form>
        </div>
    </ui:define>
</ui:composition>